<?php

namespace app\api\controller\meet;

use app\common\controller\Api;

class Faq extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * @var \app\common\model\meet\Faq
     */
    protected $model = null;

    public function _initialize()
    {
        parent::_initialize();

        $this->model = new \app\common\model\meet\Faq();
    }

    public function index()
    {
        $condition = [
            'status' => $this->model::STATUS_NORMAL
        ];

        $list = $this->model
            ->where($condition)
            ->field('id,title,content')
            ->order(['weigh' => 'desc'])
            ->select();

        $this->success('', ['list' => $list]);
    }
}
